﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using HtmlAgilityPack;
using WebArchiveCopier.IO;

namespace WebArchiveCopier
{
	public class ItemListPage : WebPage
	{

		public ItemListPage(string address, IDataManager dataManager) :
			base(WebArchive.GetItemListAddress(address), dataManager)
		{
		}

		public IEnumerable<Item> Items
		{
			get
			{
				foreach (var row in Document.DocumentNode.SelectNodes("//table[@id='resultsUrl']/tbody/tr"))
				{
					yield return new Item(row);
				}
			}
		}

	}
}
